package com.jcp.service.imple;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.jcp.dao.UsersMapper;
import com.jcp.entity.Users;
import com.jcp.service.RegisterService;
@Service
public class RegisterServiceImple implements RegisterService {
	 
	//UsersMapper的依赖注入
	@Autowired
	private UsersMapper um;
	@Override
	public void ZhuCheUser(Users users) {
		// TODO Auto-generated method stub
		int UserNum = um.insertUsers(users);
	}
 
	/**
	 * 注册查重
	 */
	@Override
	public boolean selectChong(Users users) {
		List<Users> list = um.selectChong(users);
		if(list.size()!=0) {
			return true;
		}else {
			return false;
		}
	}
	/**
	 * 登录界面登录方法
	 */
	public Users LoginUser(Users user){
		Users users = um.selectOne(user);
		return users;
	}
	
	@Override
	public Users selectByOne(Users users) {
		// TODO Auto-generated method stub
		
		return um.selectLogin(users);
	}
}
